package com.kitty.game.baxian.controller;

import com.kitty.common.utils.SpringUtils;
import com.kitty.game.baxian.message.RespBaxianMengJingInfo;
import com.kitty.game.enter.RespGeneralNotify;
import com.kitty.game.role.model.Role;
import com.kitty.game.utils.NotifyModules;
import com.kitty.mina.message.MessagePusher;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;

@Controller
@Slf4j
public class BaXianController {
    public void openBaXianDlg(Role role, String msg){
        //
        RespGeneralNotify respGeneralNotify2 = new RespGeneralNotify();
        respGeneralNotify2.setNotify((short) NotifyModules.NOTIFY_OPEN_DLG); //打开对话框
        respGeneralNotify2.setValue("EightImmortalsDlg");
        MessagePusher.pushMessage(role, respGeneralNotify2);

       openEightImmortalsDlg(role);
    }

    public void openEightImmortalsDlg(Role role) {

        RespBaxianMengJingInfo respBaxianMengJingInfo =new RespBaxianMengJingInfo();
        respBaxianMengJingInfo.setIndex((byte)(role.getExtendBox().getBaxianIndex()-1));
        respBaxianMengJingInfo.setTimes((short)0);
        respBaxianMengJingInfo.setCurCheckPoint((short)(role.getExtendBox().getBaxianIndex()-1));
        respBaxianMengJingInfo.setMainState((byte) 0);
        respBaxianMengJingInfo.setOpenMax((short) 9);
        respBaxianMengJingInfo.setIsOpenDlg((byte) 1);
        respBaxianMengJingInfo.setEnterNightmare((byte) 0);
        respBaxianMengJingInfo.setIsSweep((byte) 1);
        MessagePusher.pushMessage(role, respBaxianMengJingInfo);
    }
}
